<?php defined('INDEX_FILE') or die('forbidden');


/**
* MLT Web Engine
* http://www.molotsoft.ru
*
* @package MLT_WE
* @subpackage Lucky_Funcs
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: lucky_funcs.inc.php 129 2009-02-21 16:17:47Z molotsoft@gmail.com $
* @link $HeadURL: http://lucky-funcs.googlecode.com/svn/branches/version_1/lucky_funcs.inc.php $
*/


define('LFNC_PACKAGE', 'Lucky_Funcs');
define('LFNC_VERSION', '1.0.0');

define('LFNC_PHP_VERSION', '4.3.3'); // glob_onlydir
version_compare(PHP_VERSION, LFNC_PHP_VERSION, '>=') or trigger_error('required PHP_VERSION >= ' . LFNC_PHP_VERSION, E_USER_NOTICE);


define('LFNC_ROOT_DIR', pathinfo(__FILE__, PATHINFO_DIRNAME) . '/');
define('LFNC_PHP_EXT', '.' . pathinfo(__FILE__, PATHINFO_EXTENSION));

define('LFNC_PLUGINS_DIR', LFNC_ROOT_DIR . 'funcs/');
define('LFNC_PLUGIN_EXT', '.lfnc' . LFNC_PHP_EXT);


function glob_r($pattern, $flags = 0, $flags_onlydir = 0) {
	$data = glob($pattern, $flags); // php 4 >= 4.3.0
	$p = pathinfo($pattern);
	foreach (glob($p['dirname'] . '/*', $flags_onlydir | GLOB_ONLYDIR) as $sub_dirname) { // php 4 >= 4.3.3
		$data = array_merge($data, glob_r($sub_dirname . '/' . $p['basename']));
	}
	return $data;
}

foreach (glob_r(LFNC_PLUGINS_DIR . '*' . LFNC_PLUGIN_EXT) as $filename) {
	require_once($filename);
}


?>